package com.icw.utility;

import org.apache.commons.lang3.ArrayUtils;
import org.apache.tomcat.util.buf.StringUtils;

public class PropertyPathHelper {

	public static String popAndReturn(String propertyPath) {
		String[] properties = PoEntityHelper.splitProperties(propertyPath);
		return StringUtils.join(ArrayUtils.subarray(properties, 0, properties.length - 1));
	}

	public static String pop(String propertyPath) {
		String[] properties = PoEntityHelper.splitProperties(propertyPath);
		return properties[properties.length - 1];
	}
}
